/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.team1160.breakaway.api;

import edu.wpi.first.wpilibj.Joystick;

/**
 *
 * @author CJ
 */
public interface Constants {

    public static final int TEAM_ID = 1160;

    public static final String TEAM_NAME = TEAM_ID+" Firebird";

    //ID Variables
    ////////////////////////////////////////////////////////////////////////////
    //drivetrain
    public static final byte ID_DRIVETRAIN_LEFT  = 0;//00
    public static final byte ID_DRIVETRAIN_RIGHT = 1;//01
    public static final byte ID_DRIVETRAIN_FRONT = 0;//00
    public static final byte ID_DRIVETRAIN_BACK  = 2;//10

    public static final byte ID_DRIVETRAIN_LEFT_FRONT =
                              ID_DRIVETRAIN_LEFT|ID_DRIVETRAIN_FRONT;//00
    public static final byte ID_DRIVETRAIN_RIGHT_FRONT =
                              ID_DRIVETRAIN_RIGHT|ID_DRIVETRAIN_FRONT;//01
    public static final byte ID_DRIVETRAIN_LEFT_BACK =
                              ID_DRIVETRAIN_LEFT|ID_DRIVETRAIN_BACK;//10
    public static final byte ID_DRIVETRAIN_RIGHT_BACK =
                              ID_DRIVETRAIN_RIGHT|ID_DRIVETRAIN_BACK;//11


    //kicker
    public static final byte ID_KICKER_FRONT  = 0;//00
    public static final byte ID_KICKER_BACK   = 1;//01
    public static final byte ID_KICKER_FIRE   = 0;//00
    public static final byte ID_KICKER_LATCH  = 2;//10

    public static final byte ID_KICKER_SOLENOID_FIRE_FRONT = ID_KICKER_FRONT|ID_KICKER_FIRE;//00
    public static final byte ID_KICKER_SOLENOID_FIRE_BACK = ID_KICKER_BACK|ID_KICKER_FIRE;//01
    public static final byte ID_KICKER_SOLENOID_LATCH_FRONT = ID_KICKER_FRONT|ID_KICKER_LATCH;//10
    public static final byte ID_KICKER_SOLENOID_LATCH_BACK = ID_KICKER_BACK|ID_KICKER_LATCH;//11

    ///////////////////////////////////////////////////////////////////////////
    //DriveTrain

    public static final int C_DT_LEFT_BACK = 1;
    public static final int C_DT_LEFT_FRONT = 2;
    public static final int C_DT_RIGHT_BACK = 3;
    public static final int C_DT_RIGHT_FRONT = 4;

    public static final int C_ENC_DT_LEFT_BACK_A = 10;
    public static final int C_ENC_DT_LEFT_BACK_B = 9;
    public static final int C_ENC_DT_LEFT_FRONT_A = 8;
    public static final int C_ENC_DT_LEFT_FRONT_B =7;
    public static final int C_ENC_DT_RIGHT_BACK_A = 6;
    public static final int C_ENC_DT_RIGHT_BACK_B = 5;
    public static final int C_ENC_DT_RIGHT_FRONT_A = 4;
    public static final int C_ENC_DT_RIGHT_FRONT_B = 3;

    public static final double ENCODER_DISTANCE_PER_PULSE = 5.0;
    public static final boolean SQUARE_JOYSTICK_INPUTS = false;

    public static final int JAGUAR_MAX_PWN = 255;
    public static final int JAGUAR_MIN_PWN = 1;
    public static final int JAGUAR_MID_PWN = 128;
    public static final int JAGUAR_UP_DEAD_PWN = 135;
    public static final int JAGUAR_DOWN_DEAD_PWN = 121;

    //////////////////////////////////////////////////////////////////////////
    //DriverStation

    public static final int C_DRIVE_JOYSTICK = 1;
    public static final int C_DRIVERSTATION_DRIBBLER_SWITCH = 4;
    public static final int C_DRIVERSTATION_KICKER_SWITCH = 2;
    public static final int C_DRIVERSTATION_AUTO_SWITCH_ONE = 5;
    public static final int C_DRIVERSTATION_AUTO_SWITCH_TWO = 7;
    public static final int C_ORIENT_BY_CAMERA = 2;


    public static final int C_SAFETY_MODE_BYTE_VALUE = 256;//2^8
    public static final int C_RIGHT_FRONT_MOTOR_BYTE_VALUE = 1024;//2^10
    public static final int C_RIGHT_BACK_MOTOR_BYTE_VALUE = 512;//2^9
    public static final int C_LEFT_FRONT_MOTOR_BYTE_VALUE = 32;//2^5
    public static final int C_LEFT_BACK_MOTOR_BYTE_VALUE = 64;//2^6
    
    public static final double CAMERA_SPEED_INGREMENT = 0.5;


    //Kicker
    ////////////////////////////////////////////////////////////////////////////
    public static final int C_FIRE_FRONT=2;
    public static final int C_FIRE_BACK=1;
    public static final int C_LATCH_FRONT=4;
    public static final int C_LATCH_BACK=3;

    public static final long DELAY_KICKER_RELEASE = 500;
    public static final long DELAY_KICKER_HOLDING = 500;
    public static final long DELAY_KICKER_RETRACT = 500;

    //Pnuematics
    ///////////////////////////////////////////////////////////////////////////
    public static final int C_COMPRESSOR_RELAY = 1;
    public static final int C_COMPRESSOR_SWITCH = 1;

    //Arm
    ///////////////////////////////////////////////////////////////////////////
    public static final int C_CLAW = 7;
    public static final double CLAW_ZERO = 0.0;
    public static final double CLAW_EXTEND = 1.0;
    public static final double WINCH_ZERO = 0.0;
    public static final double WINCH_ACTIVATE = 1.0;

    //Dribbler
    ////////////////////////////////////////////////////////////////////////////
    public static final int C_DR_VICTOR = 5;
    public static final double S_DR_MOTOR = -0.50;
    public static final int DR_SENT = -1160;

    //Speeds
    ////////////////////////////////////////////////////////////////////////////
    public static final double SPEED_MAX_NOMINAL = 1.0;
    public static final double SPEED_MAX_SAFETY  = .5;

    //LED Channels
    ////////////////////////////////////////////////////////////////////////////
    public static final int LED_CAM_LEFT = 2;
    public static final int LED_CAM_CENTER = 4;
    public static final int LED_CAM_RIGHT = 6;
    public static final int LED_DRIBBLER = 8;

    //Model Camera values
    ////////////////////////////////////////////////////////////////////////////
    public static final int V_M_NO_SEE = -1;
    public static final int V_M_LEFT = 0;
    public static final int V_M_ON_TARGET = 1;
    public static final int V_M_RIGHT = 2;


    //Joystick axis values
    public static final int JOYSTICK_AXIS_X = Joystick.AxisType.kX.value + 1;
    public static final int JOYSTICK_AXIS_Y = Joystick.AxisType.kY.value + 1;




    //Error delta
    public static final double ERROR_DELTA = .150;

    public static final int TARGET_MIN_ELLIPSE_COUNT = 3;

    //distance from 0.0 to value is consider half of the center range
    public static final double CENTER_HALF_RANGE_NORMALIZED = .15;

    //Autonomous Constants
}
